<template>
  <div class="portal-custom-body" :style="borderStyle">
    <!--  模版头  -->
    <default-column-header v-if="showHeader" :temp="temp" />
    <div class="portal-custom-body" :style="contentStyle">
      <el-empty
        v-if="dataList === null || dataList.length === 0"
        :image-size="100"
      />
      <div v-else>
        <div
          v-for="(obj, index) in dataList"
          :key="'obj-' + index"
          class="portal-layout-column-item"
          :style="lineStyle"
          @click="openEntity(obj)"
        >
          <div class="column-item-body">
            <div class="column-item-time">
              <div class="time-title top">
                {{ dateSubString(obj[column[0].time], 'day') }}
              </div>
              <div class="time-title">
                {{ dateSubString(obj[column[0].time], 'time') }}
              </div>
            </div>
            <div class="column-item-title">
              <span v-if="obj[column[0].left]">[{{ obj[column[0].left] }}]</span>
              {{ obj[column[0].title] }}
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { template } from '@/mixins/template'
import DefaultColumnHeader from '@/portal4.1/pc/component/column/DefaultColumnHeader.vue'
import { layout } from '@/mixins/layout'
import { dateSubString } from '@/utils/utils'
export default {
  name: 'PcNewListTempV2',
  // 学校通知学校迎新列表,单个学校迎新的更多组件
  components: { DefaultColumnHeader },
  mixins: [template, layout],
  computed: {
    themes() {
      return this.$store.getters.theme
    },
    lineStyle() {
      return { '--font-color': this.layoutTheme.menuColor, '--font-active-color': this.layoutTheme.menuActiveColor, '--back-color': this.layoutTheme.menuActiveBackground }
    }
  },
  methods: { dateSubString }
}
</script>

<style lang="scss" scoped>
.portal-custom-body {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  flex-flow: column nowrap;
  background-color: #ffffff;
  border-radius: 4px;
  padding: 0px 0px 10px 0px;
  box-sizing: border-box;
  overflow: hidden;
}
.portal-custom-body {
  width: 100%;
  flex: 1 1;
  padding: 0 10px;
  overflow: hidden;
  box-sizing: border-box;
}
.portal-layout-column-item {
  position: relative;
  width: 100%;
  height: 70px;
  padding: 5px 10px;
  box-sizing: border-box;
  cursor: pointer;
  color: var(--font-color);
  .column-item-body {
    width: 100%;
    height: 100%;
    display: flex;
    flex-flow: row nowrap;
    .column-item-time {
      width: 60px;
      height: 60px;
      border: 1px solid #3F51B5;
      .time-title {
        width: 100%;
        text-align: center;
        height: 30px;
        font-size: 0.9rem;
        color: #3F51B5;
        line-height: 30px;
      }
      .time-title.top {
        background-color: #3F51B5;
        color: #ffffff;
        font-size: 1.4rem;
        font-weight: bold;
      }
    }
    .column-item-title {
      flex: 1 1;
      height: 50px;
      line-height: 20px;
      padding-left: 5px;
      box-sizing: border-box;
      font-size: 0.9rem;
      margin-top: 10px;
      span {
        color: var(--edu-primary-100);
      }
    }
  }
  .column-item-body:hover {
    .column-item-title {
      color: var(--edu-primary-100);
    }
  }
}

</style>
